import React, { Component } from 'react'
// 引入contextObj 对象
import contextObj from './context';
console.log('contextObj1', contextObj);
const { Consumer } = contextObj
export default class Grandson extends Component {
    render() {
        return (
            <div>
                <p>Grandson</p>
                <Consumer>
                    {
                        (value) => {
                            {/* console.log('value',value) */ }
                            return <div>
                                <p>{value.name}</p>
                                <p>{value.age}</p>
                            </div>
                        }
                    }
                </Consumer>
            </div>
        )
    }
}
